import request from '@/utils/request';

// 分页获取推荐视频
export function getVideo(params) {
    return request({
        url: `/video/list/${params.pagenum}/${params.pagesize}`,
        method: 'get'
    })
}

// 分页查询视频
export function searchVideo(params) {
    return request({
        url: `/video/seach/${params.pagenum}/${params.pagesize}?keyword=${params.keyword}`,
        method: 'get'
    })
}

// 新增
export function addVideo(data) {
    return request({
        url: `/video/upload?title=${data.title}&uploader=${data.uploader}&video_url=${data.url}`,
        method: 'post'
    })
}

// 修改视频信息
export function updateVideo(data) {
    return request({
        url: `/video/update?id=${data.id}`,
        method: 'put',
        data:data.updateInfo
    })
}

// 删除视频
export function deleteVideo(data) {
    return request({
        url: `/video/delete?id=${data}`,
        method: 'delete'
    })
}

// 批量删除